﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zen4SyncModel
{
    public interface IEntityProvider
    {
        /// <summary>
        /// Returns all the clientSession entities of a testSession running on a testServer.
        /// </summary>
        /// <param name="testSessionId">Unique identifier of the Zen4Sync testSession.</param>
        /// <param name="testServerId">Unique identifier of the Zen4Sync testServer.</param>
        /// <returns>All the clientSession entities of a testSession running on a testServer.</returns>
        List<clientSession> GetTestSessionDetails( Guid testSessionId, Guid testServerId );

        /// <summary>
        /// Returns a syncSession entity from a given syncSession id
        /// </summary>
        /// <param name="syncSessionId">Unique identifier of a Zen4Sync syncSession</param>
        /// <returns>A syncSession entity</returns>
        syncSession GetSyncSession( Guid syncSessionId );

        /// <summary>
        /// Returns an activity entity from a given activity id
        /// </summary>
        /// <param name="activityId">Unique identifier of a Zen4Sync activity</param>
        /// <returns>An activity entity</returns>
        activity GetActivity( Guid activityId );

        /// <summary>
        /// Returns a sqlServerExecution entity from a given sqlServerExcecution id
        /// </summary>
        /// <param name="sqlServerExecutionId">Unique identifier of a Zen4Sync sqlServerExecution</param>
        /// <returns>A sqlServerExecution entity</returns>
        sqlServerExecution GetSqlServerExecution( Guid sqlServerExecutionId );

        /// <summary>
        /// Returns a sqlServerCheckData entity from a given sqlServerCheckData id
        /// </summary>
        /// <param name="sqlServerCheckDataId">Unique identifier of a Zen4Sync sqlServerCheckData</param>
        /// <returns>A sqlServerCheckData entity</returns>
        sqlServerCheckData GetSqlServerCheckData( Guid sqlServerCheckDataId );

        /// <summary>
        /// Returns a sqlceExecution entity from a given sqlceExecution id
        /// </summary>
        /// <param name="sqlceExecutionId">Unique identifier of a Zen4Sync sqlceExecution</param>
        /// <returns>A sqlceExecution entity</returns>
        sqlceExecution GetSqlceExecution( Guid sqlceExecutionId );

        /// <summary>
        /// Returns a sqlceCheckData entity from a given sqlceCheckData id
        /// </summary>
        /// <param name="sqlceCheckDataId">Unique identifier of a Zen4Sync sqlceCheckData</param>
        /// <returns>A sqlceCheckData entity</returns>
        sqlceCheckData GetSqlceCheckData( Guid sqlceCheckDataId );

        /// <summary>
        /// Returns a sqlceBackup entity from a given sqlceBackup id
        /// </summary>
        /// <param name="sqlceBackupId">Unique identifier of a Zen4Sync sqlceBackup</param>
        /// <returns>A sqlceBackup entity</returns>
        sqlceBackup GetSqlceBackup( Guid sqlceBackupId );

        /// <summary>
        /// Returns a mefExecution entity from a given mefExecution id
        /// </summary>
        /// <param name="mefExecutionId">Unique identifier of a Zen4Sync mefExecution</param>
        /// <returns>A mefExecution entity</returns>
        mefExecution GetMefExecution( Guid mefExecutionId );

        /// <summary>
        /// Returns a sqlServerExecutionContext entity from a given sqlServerExecutionContext id
        /// </summary>
        /// <param name="sqlServerExecutionContextId">Unique identifier of a Zen4Sync sqlServerExecutionContext</param>
        /// <returns>A sqlServerExecutionContextEntity</returns>
        sqlServerExecutionContext GetSqlServerExecutionContext( Guid sqlServerExecutionContextId );


        /// <summary>
        /// Returns a sqlServerCheckDataContext entity from a given sqlServerCheckDataContext id
        /// </summary>
        /// <param name="sqlServerCheckDataContextId">Unique identifier of a Zen4Sync sqlServerCheckDataContext</param>
        /// <returns>A sqlServerCheckDataContext Entity</returns>
        sqlServerCheckDataContext GetSqlServerCheckDataContext( Guid sqlServerCheckDataContextId );

        /// <summary>
        /// Returns a sqlceExecutionContext entity from a given sqlceExecutionContext id
        /// </summary>
        /// <param name="sqlceExecutionContextId">Unique identifier of a Zen4Sync sqlceExecutionContext</param>
        /// <returns>A sqlceExecutionContext Entity</returns>
        sqlceExecutionContext GetSqlceExecutionContext( Guid sqlceExecutionContextId );

        /// <summary>
        /// Returns a sqlceBackupContext entity from a given sqlceBackupContext id
        /// </summary>
        /// <param name="sqlceBackupContextId">Unique identifier of a Zen4Sync sqlceBackupContext</param>
        /// <returns>A sqlceBackupContext Entity</returns>
        sqlceCheckDataContext GetSqlceCheckDataContext( Guid sqlceCheckDataContextId );

        /// <summary>
        /// Returns a sqlceCheckDataContext entity from a given sqlceCheckDataContext id
        /// </summary>
        /// <param name="sqlceCheckDataContextId">Unique identifier of a Zen4Sync sqlceCheckDataContext</param>
        /// <returns>A sqlceCheckDataContext Entity</returns>
        sqlceBackupContext GetSqlceBackupContext( Guid sqlceBackupContextId );

        /// <summary>
        /// Returns a mefExecutionContext entity from a given mefExecutionContext id
        /// </summary>
        /// <param name="mefExecutionContextId">Unique identifier of a Zen4Sync mefExecutionContext</param>
        /// <returns>A mefExecutionContext Entity</returns>
        mefExecutionContext GetMefExecutionContext( Guid mefExecutionContextId );

        /// <summary>
        /// Returns a syncSessionContext entity from a given syncSessionContext id
        /// </summary>
        /// <param name="syncSessionContextId">Unique identifier of a Zen4Sync syncSessionContext</param>
        /// <returns>A syncSessionContext Entity</returns>
        syncSessionContext GetSyncSessionContext( Guid syncSessionContextId );

        /// <summary>
        /// Returns a testServer entity from a given testServer id
        /// </summary>
        /// <param name="testServerId">Unique identifier of the TestServer</param>
        /// <returns>A testServer entity from a given testServer id</returns>
        testServer GetTestServer( Guid testServerId );

        /// <summary>
        /// Returns all the clientSession entities of a testSession.
        /// </summary>
        /// <param name="testSessionId">Unique identifier of the Zen4Sync testSession.</param>
        /// <returns>All the clientSession entities of a testSession</returns>
        List<clientSession> getClientSessions( Guid testSessionId );

        //TODO: A tester
        /// <summary>
        /// Returns the path where the mef component is located
        /// </summary>
        /// <param name="mefExecutionId">Unique identifier of the Zen4Sync mefExecution</param>
        /// <returns>The path where the mef component is located</returns>
        String GetMefDeploymentDirectory( Guid mefExecutionId );

        /// <summary>
        /// Returns a byte table that containts the encrypted value of the data in the input.
        /// </summary>
        /// <param name="decryptedData">The data that should be encrypted</param>
        /// <param name="id">The unique identifier of the data</param>
        /// <param name="keyPassword">The password of the symmetric key</param>
        /// <returns>A byte table</returns>
        Byte[] EncryptData( String decryptedData, Guid id, String keyPassword );


        /// <summary>
        /// Returns a string that containts the decrypted value of the data in the input.
        /// </summary>
        /// <param name="decryptedData">The data that should be decrypted</param>
        /// <param name="id">The unique identifier of the data</param>
        /// <param name="keyPassword">The password of the symmetric key</param>
        /// <returns>The decrypted data</returns>
        String DecryptData( Byte[] encryptedData, Guid id, String keyPassword );


    }
}
